package com.bluesky.jwf.example1.domain;

import com.bluesky.jwf.example1.forms.FunctionTreeViewItem;

public class FunctionService {

	private static Function root;
	static {

		root = new Function("Menu", "");

		Function systemCategory = new Function("System", "");
		Function login = new Function("Login", "Login");
		Function logout = new Function("Logout", "Logout");

		systemCategory.addChild(login);
		systemCategory.addChild(logout);

		root.addChild(systemCategory);

		// standard
		Function standardCategory = new Function("Standard", "");
		Function select = new Function("Select", "Select");
		Function hyperLinkButton = new Function("HyperLinkButton",
				"HyperLinkButton");
		Function richTextField = new Function("RichTextField","RichTextField");
		Function fileUpload = new Function("FileUpload", "FileUpload");
		Function image = new Function("Image", "Image");
		Function listView = new Function("ListView", "ListView");
		Function dataTable = new Function("DataTable", "DataTable");

		standardCategory.addChild(select);
		standardCategory.addChild(hyperLinkButton);
		standardCategory.addChild(richTextField);
		standardCategory.addChild(fileUpload);
		standardCategory.addChild(image);
		standardCategory.addChild(listView);
		standardCategory.addChild(dataTable);

		root.addChild(standardCategory);

		// dialog
		Function dialogCategory = new Function("Dialog", "");
		Function messageDialog = new Function("MessageDialog", "MessageDialog");
		Function customDialog = new Function("CustomDialog", "CustomDialog");
		Function modalDialog = new Function("ModalDialog", "ModalDialog");

		dialogCategory.addChild(messageDialog);
		dialogCategory.addChild(customDialog);
		dialogCategory.addChild(modalDialog);

		root.addChild(dialogCategory);

	}

	public static Function getRootFunction() {
		return root;
	}

}
